package com.iyjhsoc.game.controller;


import com.iyjhsoc.game.domain.entity.DictItemDO;
import com.iyjhsoc.game.domain.response.Response;
import com.iyjhsoc.game.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @description
 * @Author xie
 * @date 2024/9/5
 */
@RestController
@RequestMapping("dict")
public class DictController {

    @Autowired
    DictService dictService;

    @GetMapping("getDictInfo")
    public Response getDictInfo(String dictType){
        List<DictItemDO> dictInfo = dictService.getDictInfo(dictType);
        return Response.SUCCESS(dictInfo);
    }

    @GetMapping("getDictInfos")
    public Response getDictInfos(String dictTypes){
        Map<String, List<DictItemDO>> dictInfoByDictTypes = dictService.getDictInfoByDictTypes(dictTypes);
        return Response.SUCCESS(dictInfoByDictTypes);
    }

    @GetMapping("getDictInfosWhere")
    public Response getDictInfosWhere(String dictType,String where) {
        return Response.SUCCESS();
    }
}
